﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ZedGraph;

namespace TSTreeThesis.UI
{
    public partial class PAAvsDataGraphForm : Form
    {
        public PAAvsDataGraphForm()
        {
            InitializeComponent();
        }

        public Panel GetPanel()
        {
            return panel1;
        }

        public void SetData(PointPairList listData, PointPairList listPAA)
        {
            zedOriginalGraph.GraphPane.CurveList.Clear();
            addLine(zedOriginalGraph, "Data", listData, Color.Red, SymbolType.None, 1, "Original Data Graph");

            zedPAAGraph.GraphPane.CurveList.Clear();
            addLine(zedPAAGraph, "PAA", listPAA, Color.Green, SymbolType.None, 1, "PAA Graph");
        }

        private void addLine(ZedGraphControl zgc, string name, PointPairList dataList, Color color, SymbolType s, int width, string filename)
        {
            GraphPane myPane = zgc.GraphPane;
            LineItem myCurve = myPane.AddCurve(name, dataList, color, s);
            myCurve.Line.Width = width;
            myPane.Title.Text = filename;
            myPane.XAxis.Title.Text = "Times";
            myPane.YAxis.Title.Text = "Values";
            zgc.AxisChange();
            zgc.Refresh();
        }
    }
}
